package com.myres.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.myres.dao.UserDao;
import com.myres.model.User;

public class UserService {
	private UserDao userDao;

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public User get(int id) {
		return userDao.get(id);
	}

	public User load(int id) {
		return userDao.load(id);
	}

	public List<User> findByName(String name) {
		return userDao.findByName(name);
	}

	@Transactional(readOnly = false)
	public void delete(User user) {
		userDao.delete(user);
	}

	@Transactional(readOnly = false)
	public int update(User user) {
		return userDao.update(user);
	}

	@Transactional(readOnly = false)
	public int save(User user) {
		return userDao.save(user);
	}
}
